package com.yq.socket1;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author 3307235355@qq.com
 * @description
 * @since 2022/06/29 21:29
 */
public class Demo01 {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress a1 = InetAddress.getByName("DESKTOP-7HA902B");
        InetAddress a2 = InetAddress.getByName("192.168.13.53");
        InetAddress a3 = InetAddress.getLocalHost();
        System.out.println(a3.getHostAddress()+"---------"+a3.getHostName());
        System.out.println(a1.getHostAddress());
        System.out.println(a2.getHostAddress()+"======"+a2.getHostName());

    }
}
